-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: Style macro devtool #8305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
snowystinger
wants to merge
37
commits into
main
Choose a base branch
from
style-macro-devtool
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conflicts: # yarn.lock
3 tasks
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
994911b to
2706cd1
Compare
|
Build successful! 🎉 |
|
Build successful! 🎉 |
# Conflicts: # package.json # packages/@react-spectrum/s2/chromatic/CardView.stories.tsx # packages/@react-spectrum/s2/stories/CardView.stories.tsx # packages/@react-spectrum/s2/style/__tests__/style-macro.test.js
# Conflicts: # package.json # yarn.lock
# Conflicts: # eslint.config.mjs # packages/@react-spectrum/s2/style/__tests__/style-macro.test.js # yarn.lock
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes
Open question: Do we want to attach all of this data and behaviour in production builds? Or only during dev. For all testing in this PR you'll need to build locally so that it's the dev build otherwise you won't see anything when looking at the extension.
Follow instructions in README to run the plugin. There is also a description of the extension architecture in there as it is non-trivial due to the various sandbox that chrome imposes in addition to the different ways that a macro could be updated ie. static, dynamic, conditional static.
Note, there is a parcel bug which will cause all tabs that have had the content script injected to reload on every change. I cannot resolve this right now. If you build instead so that the extension doesn't change, then it won't do this. It's only during HMR. This will also cause every tab to refresh if a tab that had loaded the extension is closed.
For this reason, it can be easier to build the extension instead of running it as if you're developing.
Some notes, this is currently meant to be used in addition to the regular panels and AtomicCSS to determine where styles are coming from. It is not designed to replace those extensions and inspectors.
I also haven't solved how to maintain the object in the panel when doing things like hover, so it can be a little hard to inspect fleeting styles like that
None of that should prevent us from starting to use it and merging and iterating.
✅ Pull Request Checklist:
📝 Test Instructions:
I added a style macro in the commit e5ab27b which is static and is swapped with another static one on a span inside buttons. It reacts to the button being focused. You can see the extensions dev panel is updated when this swap occurs despite it being a static macro.
I removed that afterwards. So to test the updates on static macros, use that storybook build.
Otherwise, you can inspect elements and view the results in the dev tools panel.
🧢 Your Project: